package lanou.autohome.basetool;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

import cn.bmob.v3.Bmob;

/**
 * Created by dllo on 16/8/15.
 */
public abstract class BaseActivity extends AppCompatActivity implements View.OnClickListener {



    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(setLayout());
        Bmob.initialize(getApplicationContext(), "4b2cbd36c1cb7ec5a7e0c01a3c718da5");
        intiView();
        intiData();

    }
    protected abstract int setLayout();
    protected abstract void intiView();
    protected abstract void intiData();

    //简化findViewById
    protected <T extends View>T bindView(int id){
        return (T) findViewById(id);
    }

    //设置点击事件的方法,方法是不固定参数个数的,该方法可以不写
    protected void setClick(View ... views){
        for (View view : views) {
            view.setOnClickListener(this);
        }
    }

    @Override
    protected void onDestroy() {

        super.onDestroy();
    }
}
